package com.shuoyue.ycgk.views.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.shuoyue.ycgk.R;


/**
 * 带确认取消按钮的Dialog
 * Created by Forty'7 on 2019/6/17.
 */

public class AgreementTipsDialog extends Dialog {
    private Context mContext;
    private TextView yhxy;
    private TextView ystk;
    private TextView tvCancel;
    private TextView tvOk;

    public AgreementTipsDialog(@NonNull Context context) {
        super(context, R.style.dialog);
        this.mContext = context;
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.dialog_agreement);
        getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        yhxy = findViewById(R.id.yhxy);
        ystk = findViewById(R.id.ystk);
        tvCancel = findViewById(R.id.tv_cancel);
        tvOk = findViewById(R.id.tv_ok);
    }


    public void setCancelListener(View.OnClickListener listener) {
        if (tvCancel != null) tvCancel.setOnClickListener(listener);
    }

    public void setOkListener(View.OnClickListener listener) {
        if (tvOk != null) tvOk.setOnClickListener(listener);
    }

    public void setYhxyListener(View.OnClickListener listener) {
        if (yhxy != null) yhxy.setOnClickListener(listener);
    }

    public void setYstkListener(View.OnClickListener listener) {
        if (ystk != null) ystk.setOnClickListener(listener);
    }


}
